from selenium import webdriver
from time import sleep
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get('http://10.59.9.14:7003/')
driver.maximize_window()
sleep(3)
driver.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a').click()
sleep(2)
driver.find_element(By.NAME,'username').send_keys('13811033962')
driver.find_element(By.NAME,'password').send_keys('123456')
sleep(10)
driver.find_element(By.CLASS_NAME,'finish-btn').click()
sleep(5)
driver.find_element(By.XPATH,'//input[@class="search-input"  and @name="keywords"]').send_keys('手机')
driver.find_element(By.CSS_SELECTOR,'.search-input-btn').click()
sleep(10)
yuan = driver.find_element(By.XPATH,'/html/body/div[4]/a[2]')
#①　文本值
print(yuan.text)
#②　获取元素的具体属性值（比如class）

print(yuan.get_attribute('class'))
#③　获取元素的宽高
print(yuan.size)
#④　获取元素的坐标值
print(yuan.location)
#⑤　打印元素是否可用
print(yuan.is_enabled())
#⑥　打印元素是否显示
print(yuan.is_selected())
#⑦　打印元素是否被选中
print(yuan.is_displayed())
